package com.ververica.cdc.guass.sink.jdbc.mysql.testutil;

import com.ververica.cdc.guass.sink.jdbc.testutils.DatabaseMetadata;

public class MySqlMetadata implements DatabaseMetadata {
    private final String dbName = "xcj_cdc_test";
    private final String host = "192.168.28.18";
    private final int port = 3306;
    private final String username = "root";
    private final String password = "1qaz@WSX";

    @Override
    public String getJdbcUrl() {
        return String.format("jdbc:mysql://%s:%d/%s", host, port, dbName);
    }

    @Override
    public String getJdbcUrlWithCredentials() {
        return String.format("jdbc:mysql://%s:%d/%s?user=%s&password=%s",
                host, port, dbName, username, password);
    }

    @Override
    public String getUsername() {
        return username;
    }

    @Override
    public String getPassword() {
        return password;
    }

    @Override
    public String getDriverClass() {
        return "com.mysql.cj.jdbc.Driver";
    }

    @Override
    public String getVersion() {
        return "mysql";
    }

    public String getDbName() {
        return dbName;
    }
}
